# Define here the models for your scraped items
#
# See documentation in:
# https://docs.scrapy.org/en/latest/topics/items.html

import scrapy

from components.custom_item import UpdateCustomItem


class NetDingTaxArticleItem(UpdateCustomItem):
    area_id = scrapy.Field()
    article_type = scrapy.Field()
    title = scrapy.Field()
    status = scrapy.Field()
    effective_status = scrapy.Field()
    link = scrapy.Field()
    document_number = scrapy.Field()
    issuing_unit = scrapy.Field()
    release_time = scrapy.Field()
    text = scrapy.Field()
    content_type = scrapy.Field()
    encrypt_article_id = scrapy.Field()
    article_id = scrapy.Field()
    attachment_link = scrapy.Field()
    remark = scrapy.Field()


class NetDingTaxArticleUpdateItem(NetDingTaxArticleItem):
    __update_key__ = ["encrypt_article_id", "article_id"]
    __table_name__ = "net_ding_tax_article"
    encrypt_article_id = scrapy.Field()
    article_id = scrapy.Field()
    title = scrapy.Field()


class NetDingTaxRelationshipItem(UpdateCustomItem):
    start_article_id = scrapy.Field()
    base_contact_id = scrapy.Field()
    article_contact_id = scrapy.Field()
    base_contact_name = scrapy.Field()
    colour_type = scrapy.Field()
    end_article_id = scrapy.Field()
